<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Reckoning
Description: A two-column, fixed-width design for 1024x768 screen resolutions.
Version    : 1.0
Released   : 20090629

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Reckoning by Free CSS Templates</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<script type="text/javascript">
function loadTime(){
	$.ajax({
		url: "/outlet_display",
		format: "html",
		success: function(data){
			$("#outlet_display").html(data);
		},
		error: function(jqXHR, textStatus, errorThrown){
		  alert(jqXHR + textStatus + errorThrown);
		}
	});
}
$(function(){
	loadTime();
	
	setInterval(loadTime, 3000);
});
</script>
		
<div id="header" id="title">
<p style="font-family: Times New Roman, serif; font-size: 45pt; padding-top: 17px;">Dashboard</p>
</div>
<div id="main">
<p id="notice"><%= notice %></p>
<div id="Prefs"> 
<h2>Device Settings</h2>

	<div id="outlet_display"></div>

<br />
</div>

<div id="Prefs">
<h2>Utility Settings</h2>
<table style="text-align: left">
<tr>
<td>Peak Start Time: </td><td style="text-align: left"><%= @utility_setting.peak_start.strftime("%X") %></td>
</tr>
<tr>
<td>Peak End Time: </td><td style="text-align: left"><%= @utility_setting.peak_end.strftime("%X") %></td>
</tr>
<tr>
<td>Peak Price: </td><td style="text-align: left">$<%= @utility_setting.peak_price %>0/kWh</td>
</tr>
<tr>
<td>Off-Peak Price: </td><td style="text-align: left">$<%= @utility_setting.off_peak_price %>0/kWh</td>
</tr>
</table>
<br />
<h2>Power Consumption Preference</h2>
<table>
<tr>
<td>
<%= form_for(@user_setting) do |f| %>
<div class="field">
    <%= f.select :consumption_preference, 
    [['Sell Green Power-Low Cost', '1'],['High Green Power Usage','2'],
    ['Moderate Green Power Usage','3'],['Low Green Power Usage','4'],
    ['Sell Green Power-Moderate Cost','6'],['Sell Green Power-High Cost','5']]%>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>

<h2>Utility Control Allowed</h2>
<table>
<tr>
<td><div class="field">
    <%= f.select :utility_control_lvl,
    [['No Control','4'],['Control Over Priority 3','3'],
    ['Control Over Priority 2 & 3','2'],['Full Control','1']]%>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %></td>
</tr>
</table>
  </div>

</div>
<div id="footer">
<%= link_to 'Home Page  ', main_path %> |
<%= link_to 'Power Analysis  ', analysis_path %>
</div>

</body>
</html>